/*Author: Paul West*/
#ifndef __SOMLG__THREAD__HH__
#define __SOMLG__THREAD__HH__
#include <pthread.h>

typedef pthread_mutex_t mutex_t;

void prepare_threads();
int create_and_run_thread(void *(*start_routine)(void *), void *arg, void *(end_routine)());
void thread_yield();
void thread_sleep(int microseconds);
void close_threads();

mutex_t* create_mutex();
void mutex_lock(mutex_t *mt);
void mutex_unlock(mutex_t *mt);
void mutex_cleanup(mutex_t **mt);

#endif
